import { DataItemProvider } from './data-item-provider';

/**
 * action 列表数据适配器
 *
 * @author chitanda
 * @date 2022-06-28 15:06:38
 * @export
 * @interface ListDataProvider
 * @template T
 */
export interface ListDataProvider<T extends DataItemProvider> {
  /**
   * 项点击时触发的指令
   *
   * @author chitanda
   * @date 2022-06-28 17:06:22
   * @type {string}
   */
  readonly command?: string;

  /**
   * 搜索框提示
   *
   * @author chitanda
   * @date 2022-07-06 15:07:09
   * @type {string}
   */
  readonly placeholder?: string;

  /**
   * 获取列表数据
   *
   * @author chitanda
   * @date 2022-06-29 14:06:28
   * @param {string} [searchVal]
   * @return {*}  {Promise<T[]>}
   */
  getItems(searchVal?: string): Promise<T[]>;
}
